import mysql.connector

# 连接数据库
connection = mysql.connector.connect(
    host="106.60.78.185",
    user="dh-wy-catalog",
    password="FjFtC3ADewiwBJKk",
    database="dh-wy-catalog"
)

# 创建游标
cursor = connection.cursor()

# 执行 SQL 查询
cursor.execute("SELECT * FROM catalog_book")

# 获取结果
result = cursor.fetchall()
for row in result:
    print(row)

# 关闭连接
cursor.close()
connection.close()

